using System;
using System.Collections.Generic;
using Android.App;
using Android.Views;
using Android.Widget;

namespace SpecDemo {

    public class MainAdapter : BaseAdapter
    {
        Activity _context;
        private List<string> _result = new List<string>{"item1", "item2","item3"};
        public MainAdapter(Activity context)
        {
            this._context = context;
        }

        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = _context.LayoutInflater.Inflate(Resource.Layout.Main, null);
            var control = view.FindViewById<TextView>(Resource.Id.textView1);
            control.Text = _result[position];
            return view;
        }

        public override int Count
        {
            get { return _result.Count; }
        }

        public override Java.Lang.Object GetItem(int position)
        {
            return null;
        }

        public override long GetItemId(int position)
        {
            return position;
        }
    }
}